package cn.edu.scau.cmi.zhangjinchuan.adapter;

import java.util.ArrayList;

public class AdapterOfObject implements SortStudent{
	
	SortUtil sortUtil = new SortUtil();
	@Override
	public  void sortWithID(ArrayList<Student> students) {
		for(int i=0; i<students.size()-1; i++) {
			for(int j=0; j<students.size()-i-1; j++) {
				Student tStudent;
				if(students.get(j).getID() > students.get(j+1).getID()) {
					tStudent = students.get(j);
					students.set(j, students.get(j+1));
					students.set(j+1, tStudent);
				}
			}
		}
	}

}
